import { GCellRenderer } from "../../../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../../../common/ObjCreate";
import { ImagesConst } from "../../../../resource/ImagesConst";
import { GlobalClass } from "../../../../../../com/mui/core/GlobalClass";
import { GTextFormat } from "../../../../../common/GTextFormat";
import { FontUtil } from "../../../../../common/font/FontUtil";
import { SArenaCrossBetToplist } from "../../../../../../Message/Public/SArenaCrossBetToplist";
import { GlobalStyle } from "../../../../../common/global/GlobalStyle";
import { EntityUtil } from "../../../../scene/layer/utils/EntityUtil";
import { Language } from "../../../../../../extend/language/Language";
//class ArenaCrossFinalStatusRankCellRenderer
    
    export  class ArenaCrossFinalStatusRankCellRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            ObjCreate.createBg(4, 2, 443, 2, this, ImagesConst.SplitLine);
            this._handBm = GlobalClass.getBitmap(ImagesConst.RangeAdore);
            this._handBm.x = 20;
            this._handBm.y = 8;
            addChild(this._handBm);
            this._handBm.visible = false;
            this._rankTx = ObjCreate.createTextField("", 55, 9, 20, 20, this);
            this._nameTx = ObjCreate.createTextField("", 132, 9, 170, 20, this, new GTextFormat(FontUtil.songtiName, 12, 65535, null, null, null, null, null, flash.text.TextFormatAlign.CENTER));
            this._statusValueTx = ObjCreate.createTextField("", 334, 9, 98, 20, this, new GTextFormat(FontUtil.songtiName, 12, 65535, null, null, null, null, null, flash.text.TextFormatAlign.CENTER));
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            this._info = arg1 as SArenaCrossBetToplist;
            if (this._info) 
            {
                this._rankTx.text = this._info.rank.toString();
                if (this._info.rank != 1) 
                {
                    if (this._info.rank != 2) 
                    {
                        if (this._info.rank != 3) 
                        {
                            this._rankTx.setTextFormat(GlobalStyle.textFormat1);
                            this._handBm.visible = false;
                        }
                        else 
                        {
                            this._rankTx.setTextFormat(GlobalStyle.textFormatBlue);
                            this._handBm.visible = true;
                        }
                    }
                    else 
                    {
                        this._rankTx.setTextFormat(GlobalStyle.textFormat8);
                        this._handBm.visible = true;
                    }
                }
                else 
                {
                    this._rankTx.setTextFormat(GlobalStyle.textFormatOrange);
                    this._handBm.visible = true;
                }
                this._nameTx.text = "[" + EntityUtil.getProxyName(this._info.entityId) + "]" + this._info.name;
                this._statusValueTx.text = this._info.betNum.toString() + Language.getString(44310);
            }
            else 
            {
                this._rankTx.text = "";
                this._nameTx.text = "";
                this._statusValueTx.text = "";
            }
            return;
        }

        /* internal */ /* var */_handBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_rankTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_nameTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_statusValueTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_info: SArenaCrossBetToplist;
    }
